package StringAlgorithms;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.LinkedList;
import java.util.Queue;

class Solver1684
{	char[] ori,lst;
	Queue<String> rs=new LinkedList<String>();
	
	public void Input() throws IOException
	{	StreamTokenizer in=new StreamTokenizer(new InputStreamReader(System.in));
		in.nextToken();ori=in.sval.toCharArray();
		in.nextToken();lst=in.sval.toCharArray();
	}
	private int[] KMPtable(char[] pat)
	{	int[] T=new int[pat.length+1];
		T[0]=-1;int t=-1;
		for (int j=1;j<=pat.length;j++)
		{	while (t>=0 && pat[t]!=pat[j-1])
				t=T[t];
			t++;
			T[j]=(j==pat.length || pat[t]!=pat[j])?t:T[t];
		}
		return T;
	}
	public void Solve() throws IOException
	{	Input();
		int st=0,i=0;
		int[] T=KMPtable(ori);
		
		while (true)
		{	while ((st+i<lst.length && i<ori.length) && (lst[st+i]==ori[i])) i++;
			if (st+i==lst.length)
			{	rs.add(new String(lst,st,i));
				break;
			}
			if (T[i]!=-1)
			{	rs.add(new String(lst,st,i-T[i]));
				st+=i-T[i];
				i=(T[i]>0)?T[i]:0;
			}
			else
			{	rs.clear();break;
			}
		}
		if (rs.isEmpty()) System.out.println("Yes");
		else
		{	System.out.println("No");
			while (!rs.isEmpty())
				System.out.print(rs.remove()+' ');
		}
	}
}
public class P1684
{	public static void main(String[] args) throws IOException
	{	Solver1684 solver=new Solver1684();
		solver.Solve();
	}
}
